package org.ikastola

import ikastola.Constants;

import java.util.Date;

/**
 * Representa descuentos por pago en termino. Por rango de fechas
 *
 * @author mariano
 *
 */

class DateDiscount {

	Double value
	String description
	Integer iniday
	Integer endday 
	Fee fee
	Integer deleted
	Date classCreated
	Date classUpdated
	
	static constraints = {
		value blank:false
		description blank:false
		iniday inList: [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31] 
		endday inList: [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31]
		deleted blank: false
		classCreated nullable: true
		classUpdated nullable: true
		fee blank: false
	}

	def static list() {
		return findAllByDeleted(Constants.NOT_DELETED)
	}
}
